package leetCode.fourthWeek;

import java.util.LinkedList;
import java.util.List;
import java.util.Queue;

public class Code_65 {
  public boolean isNumber(String s) {
    Queue<Character> tmp = new LinkedList();
    List<Character> map = new LinkedList<>();
    Character[] map_tmp =
        new Character[] {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'e', '+', '-', '.'};

    for (Character i : map_tmp) {
      map.add(i);
    }

    for (int i = 0; i < s.length(); i++) {
      if (!map.contains(s.charAt(i))) { // 包含特殊元素
        return false;
      }
      if (s.charAt(i) != ' ') {
        tmp.add(s.charAt(i));
      }
    }
    return true;
  }
}
